<template id="shop">
    <div class="shop_box">

        <div class="shop_te">
            <div class="shop">
                <img src="../image/dayu.jpg" alt="" @click="getShop()">
                <h4>购物车</h4>
                <span @click="complete()">{{edit}}</span>
            </div>
            <div class="shop_add">
                <div class="shop_con" v-show="! address_line.consignee" @click="addressShow()">
                    <img src="../image/shop_x.jpg" alt="">
                    <img src="../image/address.jpg" alt="">
                    <h5>添加地址</h5>
                    <img src="../image/day.jpg" alt="">
                </div>

                <div class="shop_detail_add" v-show="address_line.consignee" @click="addressShow()">
                    <div class="shop_con_detail">
                        <img src="../image/shop_x.jpg" alt="">
                        <img src="../image/day.jpg" alt="">
                        <img src="../image/address.jpg" alt="">
                        <p><span>{{address_line.consignee}}</span><span>{{address_line.mobile}}</span></p>
                        <p>{{address_line.address}}</p>
                    </div>
                </div>
            </div>
            <ul class="shop_list">
                <li>商品清单</li>
                <li>总重约{{all_weight}}kg</li>
            </ul>
            <div class="shop_lis" v-for="v in cart_list">

                <div class="shop_d_1">
                    <span v-if="v.is_gift != 1" v-bind:class="GLOBAL.isInArray(v.rec_id, rec_ids) ? 'radio radio_selected' : 'radio'" @click="choice(v.rec_id)"></span>
                    <span v-if="v.is_gift == 1" v-bind:class="GLOBAL.isInArray(v.rec_id, rec_ids) ? 'radio radio_selected' : 'radio'"></span>
                    <img :src="v.goods_thumb" alt="">
                </div>
                <div class="shop_d_2">
                    <h6>{{v.goods_name}}</h6>
                    <p class="sp_p">{{v.goods_share}}  {{v.goods_weight}}kg</p>
                    <div class="shop_add_r">
                        <span>¥{{v.goods_price}}</span>
                        <!--<span>当日到</span>-->
                    </div>
                </div>
                <div class="shop_d_3">
                    <div class="shop_a_j" v-bind:id="'save_num_' + v.rec_id" data="1">
                        <div v-if="v.is_gift != 1" class="j_1" @click="saveNumber(v, 1)"><img src="../image/add_mm.png" alt=""></div>
                        <span class="yi">{{v.goods_number}}</span>
                        <div v-if="v.is_gift != 1" class="jia_add" @click="saveNumber(v, 2)"><img src="../image/add_mg.png" alt=""></div>
                    </div>
                </div>
            </div>
        </div>
        <div>
           <!-- <component v-bind:is="a"></component>-->
            <ul class="jie_s" v-show="!pro">
            <li>
                <span v-bind:class="rec_ids.length == all_rec_id.length ? 'radio_selected' : ''" @click="checkAll()"></span>
                全选<!--{{rec_ids.length}}-{{all_rec_id.length}}-->
            </li>
            <li>合计:<span>￥{{all_amount}}</span> </li>
            <li>
                <a v-bind:class="rec_ids.length > 0 ? 'selected' : ''" @click="addOrder()">结算</a>
            </li>
            </ul>
            <!--1-->
            <ul class="jie_s" v-show="pro">
            <li><span v-bind:class="rec_ids.length == all_rec_id.length ? 'radio_selected' : ''" @click="checkAll()"></span>全选</li>
            <li @click="delCartGoods(2)">清空购物车</li>
            <li v-bind:class="rec_ids.length > 0 ? 'selected' : ''" @click="delCartGoods(1)">删除</li>
            </ul>
            <!--2-->
            <div v-show="popup" class="address_2">
                <p><img src="../image/cha.jpg" alt="" @click="disappear()">收货地址</p>
                <div class="shop2_detail_add">
                    <div class="shop2_con_detail" v-for="(v,key) in address_list">
                        <img src="../image/edit.png" alt="" @click="getEdit(key)">
                        <img src="../image/address.jpg" alt="" @click="selectAddress(v.id)">
                        <div class="xiu_2" @click="selectAddress(v.id)"><span>{{v.consignee}}</span> <span>{{v.mobile}}</span></div>
                        <div class="xiu_3" @click="selectAddress(v.id)"><span>{{v.address}}</span></div>
                    </div>
                </div>
                <p></p>
               <!-- <router-link class="a_adress" to="/shop/adress" >新增地址</router-link>-->
                <a class="a_adress" @click="newZ()">新增地址</a>
            </div>
        </div>
        <!--新增收货地址-->
        <div class="add" v-show="dd">
            <div class="add_p" >
                <p><img src="../image/cha.jpg" alt=""  v-show="this.adress_wen=='新增收货地址'?false:true" @click="close_model()">{{adress_wen}}</p>
                <p><span>收货人</span><input type="text" placeholder="填写收货人" v-model="consignee"></p>
                <p><span>收货人手机</span><input type="text" placeholder="填写手机号" v-model="mobile"></p>
                <p @click="pp()"><span>所在地区</span ><span id="sel_city"></span><img src="../image/day.jpg" alt="" id="img_te"></p>
                <p><span>详情地址</span><input type="text" placeholder="详情地址" v-model="address"></p>
                <p>
                    <span class="s_l">类型<span>(选填)</span></span>
                    <span class="s_l1">
                       <span id="span_3"><time @click="selectArType(1)" v-bind:class="[act]"></time>家</span>
                        <span id="span_4"><time @click="selectArType(2)" v-bind:class="[act1]"></time>公司</span>
                    </span>
                </p>
            </div>
            <div class="a_click" id="a_click">
                <button @click="addAddress()">保存并使用</button>
            </div>

        </div>
        <!--地址选择弹窗-->
      <div class="back_c" v-show="back1" @click="getL()"></div>
        <!--选择结束-->
    </div>
</template>
<script>
    export default {
        name:'shop',
        data(){
            return{
                add_list1:[],
                adress_wen:'新增收货地址',
                act:'',
                act1:'',
                back1:false,
                dd:false,
                pro:false,
                popup:false,
                edit:"编辑",
                a:'first',
                prese:false,
                cart_list:[],
                address_line:[],
                all_rec_id:[],
                rec_ids:[],
                all_weight:0,
                all_amount:0,
                address_list:[],

                // 地址添加的相关字段
                province:'',
                city:'',
                district:'',
                consignee:'',
                address:'',
                mobile:'',
                type:'',
                selectedIndex:[0, 0, 0],
                is_new:true
            }
        },
        methods:{
            close_model:function(){
                this.back1=false;
                this.dd=false;
            },
            /*点击编辑修改地址*/
            getEdit:function(key){
                this.is_new = false;

                this.dd=true;
                this.popup = false;
                this.adress_wen='编辑修改地址';
              /*  console.log(this.address_list);
                console.log(this.address_list[key]);*/
                this.add_list1= this.address_list[key];
                this.consignee= this.add_list1.consignee;
                this.mobile=this.add_list1.mobile;
                this.address=this.add_list1.address;
                this.selectArType(this.add_list1.type);
                $('#sel_city').text(this.add_list1.province+this.add_list1.city+this.add_list1.district);

                //初始化地址
                this.province = this.add_list1.province;
                this.city = this.add_list1.city;
                this.district = this.add_list1.district;
                this.address_city();

                this.add_list1=[];

            },
            /*全选弹框的消失*/
            getL:function(){
                if(this.popup=true){
                    this.back1=false;
                    this.popup=false;
                };
                if(this.dd=true){
                    this.back1=false;
                    this.dd=false;
                }
            },
            address_city:function(){
                //console.log(city);
                let arr = [];
                for(var i in city){
                    if(city[i]['name'] == this.province){
                        arr.push(i);

                        let sub = city[i]['sub'];
                        for(var i2 in sub){
                             if(sub[i2]['name'] == this.city){
                                arr.push(i2);

                                let sub2 = sub[i2]['sub'];
                                for(var i3 in sub2){
                                     if(sub2[i3]['name'] == this.district){
                                        arr.push(i3); 
                                     }
                                }
                            }
                        }
                    }
                }
                this.selectedIndex = arr;
            },
            /*选择地址代码*/
            pp:function(){
                var obj = this;
               /* this.back1=false;*/
                var nameEl = document.getElementById('sel_city');

                var first = []; /* 省，直辖市 */
                var second = []; /* 市 */
                var third = []; /* 镇 */

                if(this.is_new){
                    var selectedIndex = [0,0,0]; /* 默认选中的地区 */
                }else{
                    var selectedIndex = this.selectedIndex; /* 默认选中的地区 */
                }

                var checked = [0, 0, 0]; /* 已选选项 */

                function creatList(obj, list){
                    obj.forEach(function(item, index, arr){
                        var temp = new Object();
                        temp.text = item.name;
                        temp.value = index;
                        list.push(temp);
                    })
                }
                creatList(city, first);
                if (city[selectedIndex[0]].hasOwnProperty('sub')) {
                    creatList(city[selectedIndex[0]].sub, second);
                } else {
                    second = [{text: '', value: 0}];
                }

                if (city[selectedIndex[0]].sub[selectedIndex[1]].hasOwnProperty('sub')) {
                    creatList(city[selectedIndex[0]].sub[selectedIndex[1]].sub, third);
                } else {
                    third = [{text: '', value: 0}];
                }

                var picker = new Picker({
                    data: [first, second, third],
                    selectedIndex: selectedIndex,
                    title: '地址选择'
                });

                picker.on('picker.select', function (selectedVal, selectedIndex) {
                    var text1 = first[selectedIndex[0]].text;
                    var text2 = second[selectedIndex[1]].text;
                    var text3 = third[selectedIndex[2]] ? third[selectedIndex[2]].text : '';

                  
                    /*地址弹窗选中拿到的地址*/
                    obj.province = text1;
                    obj.city = text2;
                    obj.district = text3;

                    nameEl.innerText = text1 + ' ' + text2 + ' ' + text3;
                });

                picker.on('picker.change', function (index, selectedIndex) {
                    if (index === 0){
                        firstChange();
                    } else if (index === 1) {
                        secondChange();
                    }

                    function firstChange() {
                        second = [];
                        third = [];
                        checked[0] = selectedIndex;
                        var firstCity = city[selectedIndex];
                        if (firstCity.hasOwnProperty('sub')) {
                            creatList(firstCity.sub, second);

                            var secondCity = city[selectedIndex].sub[0]
                            if (secondCity.hasOwnProperty('sub')) {
                                creatList(secondCity.sub, third);
                            } else {
                                third = [{text: '', value: 0}];
                                checked[2] = 0;
                            }
                        } else {
                            second = [{text: '', value: 0}];
                            third = [{text: '', value: 0}];
                            checked[1] = 0;
                            checked[2] = 0;
                        }

                        picker.refillColumn(1, second);
                        picker.refillColumn(2, third);
                        picker.scrollColumn(1, 0)
                        picker.scrollColumn(2, 0)
                    }

                    function secondChange() {
                        third = [];
                        checked[1] = selectedIndex;
                        var first_index = checked[0];
                        if (city[first_index].sub[selectedIndex].hasOwnProperty('sub')) {
                            var secondCity = city[first_index].sub[selectedIndex];
                            creatList(secondCity.sub, third);
                            picker.refillColumn(2, third);
                            picker.scrollColumn(2, 0)
                        } else {
                            third = [{text: '', value: 0}];
                            checked[2] = 0;
                            picker.refillColumn(2, third);
                            picker.scrollColumn(2, 0)
                        }
                    }

                });

                picker.on('picker.valuechange', function (selectedVal, selectedIndex) {
                    console.log(selectedVal);
                    console.log(selectedIndex);
                });
               /* nameEl.addEventListener('click', function () {*/
                    picker.show();
               /* });*/
            },
            /*保存新增地址*/
            newZ:function(){
                this.is_new= true;
                this.dd=!this.dd;
                this.popup=false;
                this.back1=true;
                this.adress_wen='新增收货地址';
                this.add_list1=[];
                this.consignee= '';
                this.mobile='';
                this.address='';
                $('#sel_city').text('');
                this.selectArType(0);
            },
            add:function(){
                this.dd=!this.dd;
                this.popup=false;
            },
            addressShow:function () {
                if(this.popup==false){
                    if (this.address_list.length < 1) {
                        this.$http.jsonp(
                            this.GLOBAL.BaseUrl+'/mobile/api/v1/Address.php?mode=index',
                            {
                                params: {
                                    uid:this.GLOBAL.getCookie('uid'),
                                    time:this.GLOBAL.getCookie('time'),
                                    token:this.GLOBAL.getCookie('token'),
                                },
                                jsonp:'callback'
                            }
                        ).then(function (res) {
                            if (res.body.code == 201) {
                                this.GLOBAL.setCookie('logined_url', window.location.pathname + window.location.search);
                                this.$router.push('/login');
                                return false;
                            }

                            if (res.body.code != 200) {
                                alert(res.body.msg);
                                return false;
                            }

                            this.address_list = res.body.data.address_list;
                        });
                    }
                    this.popup=true;
                    this.back1=true;
                }else{
                    this.popup=false;
                }
            },
            
            disappear:function () {
                this.popup=false;
                this.back1=false;
            },

            complete:function(){
                if (this.pro==false) {
                    this.edit='完成'
                    this.pro=!this.pro
                } else {
                    this.pro=!this.pro
                    this.edit='编辑'
                }
            },
            getShop:function(){
                window.history.go(-1)
            },

            // 选择购物车商品
            choice:function (rec_id) {
                var all_weight = this.all_weight * 100;
                var weight =  parseFloat(this.cart_list[rec_id].goods_weight) * parseInt(this.cart_list[rec_id].goods_number) * 100;
                if (this.GLOBAL.isInArray(rec_id, this.rec_ids)) {
                    this.rec_ids = this.GLOBAL.removeByValue(this.rec_ids, rec_id);
                    this.all_weight = ((all_weight - weight) / 100).toFixed(2);
                } else {
                    this.rec_ids.push(rec_id);
                    this.all_weight = ((all_weight + weight) / 100).toFixed(2);
                }

                if (this.rec_ids.length < 1) {
                    this.all_amount = 0;
                } else {
                    this.$http.jsonp(
                        this.GLOBAL.BaseUrl+'/mobile/api/v1/Flow.php?mode=allGoodsAmount',
                        {
                            params:{
                                rec_ids:this.rec_ids,
                            },
                            jsonp:'callback'
                        }
                    ).then(function (res) {
                        this.all_amount = res.body.data.amount;
                    });
                }
            },

            // 全选
            checkAll:function () {
                if (this.rec_ids.length == this.all_rec_id.length) {
                    this.rec_ids = [];
                    this.all_amount = 0;
                    this.all_weight = 0;
                } else {
                    this.rec_ids = this.all_rec_id.slice(0);

                    this.$http.jsonp(
                        this.GLOBAL.BaseUrl+'/mobile/api/v1/Flow.php?mode=allGoodsAmount',
                        {
                            params:{
                                rec_ids:this.rec_ids,
                            },
                            jsonp:'callback'
                        }
                    ).then(function (res) {
                        this.all_amount = res.body.data.amount.toFixed(2);

                        var all_weight = 0;
                        for (var k in this.cart_list) {
                            all_weight += parseFloat(this.cart_list[k].goods_weight) * parseInt(this.cart_list[k].goods_number) * 100;
                        }
                        this.all_weight = all_weight / 100;
                    });
                }
            },
            
            // 更改商品数量
            saveNumber:function (arr, type) {
                var obj = document.getElementById('save_num_' + arr.rec_id);
                if (obj.getAttribute("data") != 1) {
                    return false;
                }
                obj.setAttribute("data", 2);
                var number = parseInt(arr.goods_number);
                if (type == 1) {
                    if (arr.goods_number > 1) {
                        number -= 1;
                    } else {
                        obj.setAttribute("data", 1);
                        return false;
                    }
                } else {
                    number += 1;
                }
                this.$http.jsonp(
                    this.GLOBAL.BaseUrl+'/mobile/api/v1/Flow.php?mode=saveCartGoodsNum',
                    {
                        params:{
                            rec_id:arr.rec_id,
                            rec_ids:this.rec_ids,
                            goods_num:number,
                            uid:this.GLOBAL.getCookie('uid'),
                            time:this.GLOBAL.getCookie('time'),
                            token:this.GLOBAL.getCookie('token'),
                            session_id:this.GLOBAL.getCookie('user_cart_id'),
                        },
                        jsonp:'callback'
                    }
                ).then(function (res) {
                    if (res.body.code != 200) {
                        alert(res.body.msg);
                    } else {
                        arr.goods_number = res.body.data.goods_num;

                        if(this.GLOBAL.isInArray(arr.rec_id, this.rec_ids)) {
                            if (res.body.data.amount > 0) {
                                this.all_amount = res.body.data.amount.toFixed(2);
                            } else {
                                var  all_amount = parseFloat(this.all_amount) * 100;
                                var amount = parseFloat(arr.goods_price) * 100;
                                if (type == 1) {
                                    this.all_amount = ((all_amount - amount) / 100).toFixed(2);
                                } else {
                                    this.all_amount = ((all_amount + amount) / 100).toFixed(2);
                                }
                            }

                            var all_weight = parseFloat(this.all_weight) * 100;
                            var weight = parseFloat(arr.goods_weight) * 100;
                            if (type == 1) {
                                this.all_weight = ((all_weight - weight) / 100).toFixed(2);
                            } else {
                                this.all_weight = ((all_weight + weight) / 100).toFixed(2);
                            }
                        }
                    }
                    obj.setAttribute("data", 1);
                });
            },

            // 删除购物车商品
            delCartGoods:function (type) {
                var is_all = type == 2 ? true : false;
                var rec_ids = type == 2 ? this.all_rec_id : this.rec_ids;
                if (type == 1) {
                    if (this.rec_ids.length == this.all_rec_id.length) {
                        is_all = true;
                    }
                }

                this.$http.jsonp(
                    this.GLOBAL.BaseUrl+'/mobile/api/v1/Flow.php?mode=deleteCartGoods',
                    {
                        params:{
                            rec_ids:rec_ids,
                            uid:this.GLOBAL.getCookie('uid'),
                            time:this.GLOBAL.getCookie('time'),
                            token:this.GLOBAL.getCookie('token'),
                            session_id:this.GLOBAL.getCookie('user_cart_id'),
                        },
                        jsonp:'callback'
                    }
                ).then(function (res) {
                    if (res.body.code != 200) {
                        alert(res.body.msg);
                    } else {
                        if (is_all) {
                            this.cart_list = [];
                            this.all_rec_id = [];
                        } else {
                            var arr = this.cart_list;
                            for (var k in this.rec_ids) {
                                this.GLOBAL.removeByValue(this.all_rec_id, this.rec_ids[k]);
                                arr[ this.rec_ids[k] ] = '';
                            }
                            var cart_list = {};
                            for (var k in arr) {
                                if (arr[k]) {
                                    cart_list[k] = arr[k];
                                }
                            }
                            this.cart_list = cart_list;
                        }

                        this.all_amount = 0;
                        this.all_weight = 0;
                        this.rec_ids = [];
                        this.pro=!this.pro;
                        this.edit='编辑';
                    }
                });
            },

            // 跳转结算页
            addOrder:function () {
                if (this.rec_ids.length > 0) {
                    this.GLOBAL.setCookie('logined_url', window.location.pathname + window.location.search);   /*这里是测试使用一会要把他*/
                    this.$router.push({path:'/details', query:{rec_ids:this.rec_ids}});
                    /*shop/adress/details*/
                }

                return false;
            },

            selectAddress:function (id) {
                this.$http.jsonp(
                    this.GLOBAL.BaseUrl+'/mobile/api/v1/Address.php?mode=get_line',
                    {
                        params:{
                            address_id:id,
                            uid:this.GLOBAL.getCookie('uid'),
                            time:this.GLOBAL.getCookie('time'),
                            token:this.GLOBAL.getCookie('token'),
                        },
                        jsonp:'callback'
                    }
                ).then(function (res) {
                    if (res.body.code == 201) {
                        this.GLOBAL.setCookie('logined_url', window.location.pathname + window.location.search);
                        this.$router.push('/login');
                        return false;
                    }

                    if (res.body.code != 200) {
                        alert(res.body.msg);
                        return false;
                    }

                    this.address_line = res.body.data.address_line;
                    this.popup=false;
                    this.back1=false;
                });
            },

            // 选择配送地址类型
            selectArType:function (type) {
                this.type = type;
                this.act='';
                this.act1='';
                if(this.type==1){
                    this.act = 'showY';
                };
                if(this.type==2){
                    this.act1='showY'
                }
            },

            // 保存配送地址
            addAddress:function () {
                if (! (this.province && this.city && this.district && this.consignee && this.address && this.mobile && this.type)) {
                    alert('地址请填写完整！');
                    return false;
                }

                if(this.mobile.length!=11) {
                    alert('请输入有效的手机号码！');
                    return false;
                }

                var myreg = /^(((13[\d]{1})|(14[5,7]{1})|(15[^4]{1})|(17[0,6,7,8]{1})|(18[\d]{1}))+\d{8})$/;
                if(!myreg.test(this.mobile)) {
                    alert('请输入有效的手机号码！');
                    return false;
                }

                this.$http.jsonp(
                    this.GLOBAL.BaseUrl+'/mobile/api/v1/Address.php?mode=insert',
                    {
                        params: {
                            province:this.province,
                            city:this.city,
                            district:this.district,
                            consignee:this.consignee,
                            address:this.address,
                            mobile:this.mobile,
                            type:this.type,
                            uid:this.GLOBAL.getCookie('uid'),
                            time:this.GLOBAL.getCookie('time'),
                            token:this.GLOBAL.getCookie('token'),
                        },
                        jsonp:'callback'
                    }
                ).then(function (res) {
                    if (res.body.code == 201) {
                        this.GLOBAL.setCookie('logined_url', window.location.pathname + window.location.search);
                        this.$router.push('/login');
                        return false;
                    }

                    if (res.body.code != 200) {
                        alert(res.body.msg);
                        return false;
                    }

                    this.address_line = res.body.data.address;
                    this.prese = true;
                    this.dd = false;
                    this
                });
            }
        },
        mounted:function(){

            //48
            let H = $(window).height()-48;
            $('.shop_te').height(H);

            this.$http.jsonp(
                this.GLOBAL.BaseUrl+'/mobile/api/v1/Flow.php?mode=cartList',
                {
                    params: {
                        uid:this.GLOBAL.getCookie('uid'),
                        time:this.GLOBAL.getCookie('time'),
                        token:this.GLOBAL.getCookie('token'),
                        session_id:this.GLOBAL.getCookie('user_cart_id')
                    },
                    jsonp:'callback'
                }
            ).then(function (res) {
                if (res.body.code != 200) {
                    alert(res.body.msg);
                    return false;
                }

                this.cart_list = res.body.data.cart_list;
                this.address_line = res.body.data.address_line;
                this.all_rec_id = res.body.data.rec_ids;
                this.rec_ids = res.body.data.rec_ids.slice(0);
                this.all_weight = parseFloat(res.body.data.all_weight);
                this.all_amount = parseFloat(res.body.data.all_amount);
            });
        }
    }
</script>
<style>
    #span_3{
        margin-right:0.5rem;
    }
    #span_4 time{
        left:0.35rem;
    }
  /*  .shop_con_detail p:first-of-type span{
        font-size:0.28rem;
    }*/
    .showY{
        background:darkorange;
    }
    /*弹窗背景*/
    .back_c{
        height:100%;
        width:100%;
        background:#000000;
        filter:alpha(opacity=50);
        opacity: 0.5;
        position:fixed;
        left:0;
        top:0;
        z-index: 1;
    }
    /*11111*/
    #img_te{
        left: 6rem;
    }

    /*..00*/
    .add{
        position:fixed;
        z-index:3;
        bottom:0;
        left:0;
        background: #ffffff;
        height:6rem;
    }
    #a_click{
        width:100%;
        background: #ffffff;
    }
    .a_click button{
        display:block;
        height:0.84rem;
        width:5.71rem;
        background:#ff7f00;
        color:#ffffff;
        line-height:0.84rem;
        text-align:center;
        outline: none;
        border:0;
        margin:1.45rem 0.35rem 0 0.35rem;
        font-size:0.3rem;
    }
    .add_p{
        height:3.6rem;
        width:100%;
    }
    .add_p p:nth-of-type(6){
        height:0.8rem;
        width:100%;
        display:flex;
        flex-direction: row;
    }
    .add_p p:nth-of-type(6) .s_l{
        width:2.33rem;
        display:block;
        height:0.8rem;
        line-height:0.8rem;
        color:#3c3c3c;
        font-size:0.22rem;
        text-indent: 0.3rem;
    }
    .add_p p:nth-of-type(6) .s_l1{
        display:block;
        height:0.8rem;
        width:4.07rem;
        font-size:0.2rem;
        line-height:0.8rem;
        position:relative;
        margin-left:0.5rem;
    }
    .add_p p:nth-of-type(6) .s_l1 time:nth-of-type(1){
        position:absolute;
        left:-0.5rem;
        top:0.28rem;
    }
    /*.add_p p:nth-of-type(6) .s_l1 time:nth-of-type(2){
        position:absolute;
        left:0.4rem;
        top:0.16rem ;
    }*/
    .add_p p:nth-of-type(6) .s_l1 time{
        display:block;
        height:0.25rem;
        width:0.25rem;
        border-radius:50%;
        border:1px solid #d2d1cf;
    }
    .add_p p:nth-of-type(6) .s_l span{
        font-size:0.17rem;
        color:#939393;
    }
    .add_p p{
        border-bottom:1px solid #f0f0f0;
    }
    .add_p p:nth-of-type(1){
        height:0.8rem;
        width:100%;
        line-height:0.8rem;
        /*text-align:center;*/
        text-indent: 2.5rem;
        color:#85a45a;
        font-size:0.28rem;
        position:relative;
    }
    .add_p p:nth-of-type(1) img{
        position:absolute;
        top: 0.2rem;
        left:0.2rem;
        height:0.43rem;
        width:0.51rem;
    }

   /* .add_p p:nth-of-type(1) img{
        display:block;
        position:absolute;
        width:0.31rem;
        height:0.37rem;
        left:0.27rem;
        top:0.23rem;
    }*/
    .add_p p:nth-of-type(2){
        height:0.8rem;
        width:100%;
        display:flex;
        flex-direction: row;
    }
    .add_p p:nth-of-type(2) span{
        width:2.33rem;
        display:block;
        height:0.8rem;
        line-height:0.8rem;
        color:#3c3c3c;
        font-size:0.22rem;
        text-indent: 0.3rem;
    }
    .add_p p:nth-of-type(2) input{
        display:block;
        height:0.8rem;
        width:4.07rem;
        border:0;
        outline:none;
        font-size:0.2rem;
    }
    .add_p p:nth-of-type(3){
        height:0.8rem;
        width:100%;
        display:flex;
        flex-direction: row;
        overflow: hidden;
    }
    .add_p p:nth-of-type(3) span{
        width:2.33rem;
        display:block;
        height:0.8rem;
        line-height:0.8rem;
        color:#3c3c3c;
        text-indent: 0.3rem;
        font-size:0.22rem;
    }
    .add_p p:nth-of-type(3) input{
        display:block;
        height:0.8rem;
        width:4.07rem;
        border:0;
        outline:none;
        font-size:0.2rem;
    }
    .add_p p:nth-of-type(4){
        height:0.8rem;
        width:100%;
        display:flex;
        flex-direction: row;
        position:relative;
    }
    .add_p p:nth-of-type(4) span:nth-of-type(1){
        width:2.33rem;
        display:block;
        height:0.8rem;
        line-height:0.8rem;
        color:#3c3c3c;
        font-size:0.22rem;
        text-indent: 0.3rem;
    }
    .add_p p:nth-of-type(4) span:nth-of-type(2){
        display:block;
        height:0.8rem;
        width:4.07rem;
        line-height:0.8rem;
        font-size:0.18rem;
    }
    .add_p p:nth-of-type(4) img{
        display:block;
        position:absolute;
        height:0.37rem;
        width:0.3rem;
        right:0.3rem;
        top:0.17rem;
    }
    .add_p p:nth-of-type(5){
        height:0.8rem;
        width:100%;
        display:flex;
        flex-direction: row;
        overflow:hidden;
    }
    .add_p p:nth-of-type(5) span:nth-of-type(1){
        width:2.33rem;
        display:block;
        height:0.8rem;
        line-height:0.8rem;
        color:#3c3c3c;
        font-size:0.22rem;
        text-indent: 0.3rem;
    }
    .add_p p:nth-of-type(5) input{
        display:block;
        height:0.8rem;
        width:4.07rem;
        line-height:0.6rem;
        border: 0;
        outline: none;
        font-size:0.2rem;
        overflow: hidden; /*!*自动隐藏文字*!*/
        text-overflow: ellipsis;/*!*文字隐藏后添加省略号*!*/
        white-space: nowrap;
    }
    /*999999*/


    /*yyyyyyyy*/
    .shop_te{
       /* overflow-y: scroll;*/
        overflow-x:hidden;
    }
    .shop_box{
        height:100%;
    }
    /*111111111111*/
    .address_2{
        height:7.2rem;
        width:100%;
        position:fixed;
        bottom:0;
        overflow-y:scroll;
        z-index:2;
    }
    /*111111111*/
    .address_2 p:nth-of-type(1){
        height:0.8rem;
        width:100%;
        line-height:0.8rem;
        text-align:center;
        color:#494949;
        font-size:0.28rem;
        border-bottom:1px solid #d9d9d9;
        background:#ffffff;
        position:relative;
    }
    .address_2 p:nth-of-type(1) img{
        position:absolute;
        top: 0.2rem;
        left:0.2rem;
        height:0.43rem;
        width:0.51rem;

    }
    .address_2 p:nth-of-type(2){
        height:0.8rem;
        width:100%;
        background:#ffffff;
    }
    .address_2 a{
        height:0.8rem;
        width:100%;
        background:#ff7f00;
        line-height:0.8rem;
        text-align:center;
        font-size:0.3rem;
        color:#ffffff;
        display:block;
        text-decoration:none;
    }
  .shop2_con_detail img:nth-of-type(2){
           display: block;
           position: absolute;
           height: 0.35rem;
           width: 0.27rem;
           top: 0.95rem;
           left: 0.26rem;;
       }
  .shop2_con_detail img:nth-of-type(1){
      position:absolute;
      display:block;
      height:0.6rem;
      width:0.6rem;
      top: 0.6rem;
      right:0.3rem;
  }
  .shop2_detail_add{
      height: 5.6rem;
      width: 100%;
      overflow-y: scroll;
      background: #ffffff;
  }
  .shop2_con_detail{
      padding-top: 0.3rem;
      min-height: 1.5rem;
      /* margin: 0.1rem 0; */
      width: 100%;
      position: relative;
      border-bottom: 1px solid #f0f0f0;
      background: #fff;
  }
  .xiu_2{
      width: 100%;
      height: 0.56rem;
      line-height: 0.56rem;
      color: black;
      font-size:0.28rem;
      /* margin-bottom: 0.1rem; */
      text-indent: 0.3rem;
  }
  .xiu_3{
      width:100%;
      height:1.04em;
      color:#969696;
      font-size:0.21rem;

  }
  .xiu_3 span{
      margin-left: 0.7rem;
      display: block;
      width: 3.9rem;
      font-size: 0.22rem;
      height: 1.04rem;
      line-height: 0.5rem;
      word-wrap: break-word;
  }
  .a_adress{
      position:fixed;
      bottom:0;
      z-index:3;
  }
    /*22222222*/
    .jie_s{
        display:flex;
        height:0.83rem;
        width:100%;
        /*box-shadow: -3px -3px 0px 0px #e3e3e3;*/
        position: absolute;
        bottom: 0;
        background: #fff;
        border-top:1px solid #eee;
    }
    .jie_s li{
        list-style:none;
        flex:1;
        font-size:0.22rem;
        line-height:0.83rem;
        text-align:center;
        color:#929292;
    }
    .jie_s li:nth-of-type(1){
        position:relative;
    }
    .jie_s li:nth-of-type(3){
        color:#fcfcfc;
        background:#bfbfbf;
    }
    .jie_s li:nth-of-type(3) a{
        color:#fcfcfc;
        background:#bfbfbf;
        text-decoration:none;
        display:block;
        flex:1;
    }
    .jie_s li:nth-of-type(3) a.selected{
        background-color: red;
    }
    .jie_s li:nth-of-type(2) span{
        color:#f17809;
    }
    .jie_s li:nth-of-type(1) span{
        display:block;
        height:0.25rem;
        width:0.25rem;
        border-radius:50%;
        border:1px solid #d2d1cf;
        position:absolute;
        left:0.25rem;
        top:0.29rem;
    }
    .shop_d_1{
        height:2rem;
        width:2.24rem;

        flex:1;
        position:relative;
    }
    .shop_d_1 img{
        display:block;
        height:1.54rem;
        width:1.54rem;
        margin:0.24rem 0 0 0.65rem;
    }
    .radio{
        display:block;
        height:0.25rem;
        width:0.25rem;

        border-radius:50%;
        border:1px solid #d2d1cf;
        position:absolute;
        left:0.24rem;
        top:0.9rem;
    }
    .radio_selected{
        background:url(../image/radio.jpg) no-repeat;
        background-size:cover;
        border:0.01rem solid #ff7d01;
    }

    .shop_d_2{
        width:2.04rem;
        height:2rem;
        flex:1;
    }
    .shop_d_2 h6{
        height:1rem;
        width:5rem;
        font-weight:normal;
        /*text-align:center;*/
        text-indent: 0.4rem;
        line-height:0.8rem;
        color:#353535;
        font-size:0.24rem;
    }
    .shop_d_2 .sp_p{
        height:0.45rem;

        color:#9e9e9e;
        font-size:0.20rem;
        line-height:0.45rem;
        /*text-align:center;*/
        text-indent: 0.4rem;
    }
    .shop_d_3{
        height:2rem;
        width:2.04rem;
        flex:1;
    }
    .shop_a_j{
        height:0.52rem;
        width:2.04rem;
        position:relative;
        margin-top:1.38rem;
    }
    .j_1{
        position:absolute;
        top:0;
        left:0;
    }
    .jia_add{
        position:absolute;
        top:0px;
        left:1rem;

    }
    .yi{
        position:absolute;
        top:-0.04rem;
        left:0.24rem;
    }
    .j_1{
        height:0.5rem;
        width:0.5rem;
    }
    .j_1 img{
        display:block;
        width:0.5rem;
        height:0.5rem;
    }
    .jia_add{
        height:0.5rem;
        width:0.5rem;
    }
    .jia_add img{
        display:block;
        width:0.5rem;
        height:0.5rem;
    }
    /*.shop_a_j div img{
        display:block;

        border-radius:50%;
        color:#f77602;
        border:1px solid #dbdbdb;
        text-align:center;
    }*/
    .shop_a_j span{
        display:block;
        height:0.36rem;
        width:0.36rem;
        color:#000000;
        line-height:0.58rem;
        /*text-align:center;*/
        text-indent: 0.24rem;
        font-size:0.24rem;
        margin: .03rem .19rem;
    }
    .shop_add_r span:nth-of-type(1){
        height:0.26rem;

        line-height:0.26rem;

        text-indent: 0.3rem;
        color:#ee8a23;
        font-size:0.24rem;
        position:absolute;
        left:0.1rem;
        top:0.1rem;
    }
    .shop_add_r span:nth-of-type(2){
        height:0.25rem;
        width:0.66rem;
        line-height:0.25rem;
        text-align:center;
        border:1px solid #a5be87;
        border-radius:8px;
        font-size:0.16rem;
        color:#a5be87;
        position:absolute;
        top:0.2rem;
        right:0;
    }
    .shop_add_r{
        width:1.5rem;
        height: 0.86rem;
        position:relative;
    }
    .shop_add{
        min-height:1rem;
        width:100%;
        background:#f5f4f2;
     /*   padding-top:0.2rem;*/
    }

    .shop_lis{
        height:2rem;
        width:100%;
        position:relative;
        border-top:1px solid #f0f0f0;
        display:flex;
    }
    .shop_list{
        height:0.6rem;
        width:100%;
        display:flex;
    }
    .shop_list li{
        flex:1;
        line-height:0.6rem;
        text-align:center;
        list-style:none;
        font-size:0.22rem;
        color:#9a9a9a;
    }
    .shop_con{
        min-height:0.94rem;
        width:100%;
        position:relative;
        background:#ffffff;
    }
    .shop_con img:nth-of-type(1){
        display:block;
        position:absolute;
        height:0.08rem;
        width:100%;
        top:-0.08rem;
    }
    .shop_con img:nth-of-type(2){
        display:block;
        position:absolute;
        height:0.35rem;
        width:0.27rem;
        left:0.24em;
        top:0.3rem;
    }
    .shop_con img:nth-of-type(3){
        display:block;
        position:absolute;
        right:0.22rem;
        top: 0.3rem;
        height:0.36rem;
        width:0.2rem;
    }
    .shop_con h5{
        height: 0.94rem;
        line-height:0.94rem;
        color:#5d5d5d;
        font-size:0.22rem;
        text-indent: 0.7rem;
    }
    .shop_detail_add{
        height:1.6rem;
        width:100%;
        background:#f5f4f2;
    }
    .shop_add{
        min-height:1rem;
        width:100%;
        background:#f5f4f2;
       /* padding-top:0.2rem;*/
    }
    .shop_con_detail p:nth-of-type(2){
        width:4rem;
        height:0.3rem;
        line-height:0.3rem;
        font-size:0.2rem;
        word-wrap:break-word;
        position:absolute;
        color:#8f8f8f;
        left:0.7rem;
        top:0.65rem;
    }
    .shop_con_detail p:nth-of-type(1){
        height:0.7rem;
        width:100%;
        padding:0.2rem 0 0 0.32rem;
    }
    .shop_con_detail p:nth-of-type(1) span{
        color:#5d5d5d;
        font-size:0.28rem;
        display:block;
        float:left;
    }
    .shop_con_detail p:nth-of-type(1) span:nth-of-type(1){
        height:0.7rem;
        min-width:1rem;
    }
    .shop_con_detail{
        min-height:1.5rem;;
        width:100%;
        position:relative;
        background:#ffffff;
    }
    .shop_con_detail img:nth-of-type(1){
        display:block;
        position:absolute;
        height:0.08rem;
        width:100%;
        top:-0.08rem;
    }
    .shop_con_detail img:nth-of-type(3){
        display:block;
        position:absolute;
        height:0.35rem;
        width:0.27rem;
        left:0.3em;
        top:0.67rem;
    }
    .shop_con_detail img:nth-of-type(2){
        display:block;
        position:absolute;
        right:0.22rem;
        top: 0.7rem;
        height:0.36rem;
        width:0.2rem;
    }


    .shop{
        height:0.79rem;
        width:100%;
        border-bottom:1px solid #cfcecd;
        position:relative;
        background:#ffffff;

    }
    .shop img{
        height:0.37rem;
        width:0.3rem;
        display:block;
        position:absolute;
        left:0.25rem;
        top:0.2rem;
    }
    .shop h4{
        height:0.79rem;
        color:#85a45a;
        font-size:0.28rem;
        line-height:0.79rem;
        text-align:center;
       /* font-weight:normal;*/
    }
    .shop span{
        display:block;
        height:0.79rem;
        line-height: 0.79rem;
        font-size:0.23rem;
        color:#a8bd8d;
        position:absolute;
        right:0.24rem;
        top:0;
    }


    .jie_s li:nth-of-type(3).selected{
        background-color: red;
    }
</style>

